import { createRouter, createWebHistory } from 'vue-router';

const routes = [
  {
    path: '/',
    name: 'IndexPage',
    component: () => import('@/views/index-page.vue'),
    redirect: '/home-page',
    children: [
      {
        path: '/home-page',
        name: 'HomePage',
        component: () => import('@/views/home-page.vue'),
      },
      {
        path: 'category-page',
        name: 'CategoryPage',
        component: () => import('@/views/category-page.vue'),
      },
      {
        path: '/cart-page',
        name: 'CartPage',
        component: () => import('@/views/cart-page.vue'),
      },
      {
        path: '/mine-page',
        name: 'MinePage',
        component: () => import('@/views/mine-page.vue'),
      },
    ],
  },
];

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes,
});

export default router;
